﻿namespace ScrumLite.Data
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public interface IRequestStore
    {
        Request[] RetrieveCommittedRequests(Guid projectId);
        Request[] RetrieveOpenedRequests(Guid projectId);
        Request[] RetrieveCompletedRequests(Guid projectId);
        Request RetrieveRequest(Guid requestId);
        Request RetrieveRequest(string projectId, int moniker);
        Request[] RetrieveRequests(Guid projectId, string workAreaName);
        Dictionary<WorkArea, Dictionary<byte?, int>> RetrieveRequestsByStatusByWorkArea(Guid projectId);
        Dictionary<byte?, int> RetrieveCountRequestsByStatus(Guid projectId);

        RequestStatus[] RetrieveRequestStatusList();
        int RetrieveLastMoniker(Guid projectId);
        int RetrieveLastOrder(Guid projectId);
        
        void Add(Request entity);
        void Update(Request entity, bool updateWorkAreas);
        void Delete(Guid requestId);
        void UpdateRequestsPriority(Guid[] requestIds);
        
        WorkArea[] RetrieveWorkAreas(Guid projectId);
        WorkArea[] RetrieveWorkAreas(Guid projectId, int moniker);
        void AssignWorkAreas(Guid projectId, int moniker, string[] workAreaIds);
        Dictionary<Guid, WorkAreaReport> RetrieveWorkAreasGroupedByWeight(Guid projectId);
        void SaveWorkArea(WorkArea wa);

        void CleanCommittedRequestByStatus(Guid projectId, byte[] statusList);

        int RetrieveRequestsTotalWeight(Guid projectId);

        Request[] RetrieveCommittedCompletedRequests(Guid projectId);
        int RetrieveCommittedRequestsTotalWeight(Guid projectId);
    }
}
